package kingiis.utils.trysvg.kot

import android.os.Handler
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import android.view.View
import kingiis.utils.simpleapp.BFraAct
import kingiis.utils.simpleapp.adapter.MyFraPagerAdapter
import kingiis.utils.simpleapp.anno.Layout
import kingiis.utils.simpleapp.bean.Student
import kingiis.utils.simpleapp.utils.Log
import kingiis.utils.trysvg.R
import kotlinx.android.synthetic.main.act_test.*

/**
 * Created by King on 2018/1/4 0004.
 * new main
 */
@Layout(R.layout.act_test)
class OneAct : BFraAct(), View.OnClickListener {


    override fun onClick(v: View?) {
        when (v!!.id) {

        }
    }

    override fun onFinish(): Handler? {
        return null
    }

    override fun initListener() {
    }

    override fun initView() {
        adapter = MyFraPagerAdapter(supportFragmentManager, gotFras())
        pager.adapter = adapter
        pager.currentItem = 0
//        var testData = listOf<String>("apple", "banana", "cherry", "fuck", "shit", "son", "angle", "bank")
//        testData.filter { it.startsWith("a") }
//                .sortedBy { it }
//                .map { it.trim() }
//                .forEach { Log.i("tag", "it|" + it) }
//

    }

    var fraOne: OneFra? = null
    var fraTwo: TwoFra? = null
    var fraThree: ThreeFra? = null
    var fras: ArrayList<Fragment>? = null
    var adapter: FragmentPagerAdapter? = null

    fun gotFras(): ArrayList<Fragment>? {
        fras = ArrayList()
        fraOne = OneFra()
        fraTwo = TwoFra()
        fraThree = ThreeFra()
        fras!!.add(fraOne!!)
        fras!!.add(fraTwo!!)
        fras!!.add(fraThree!!)
        return fras
    }

}